<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'defaultaccounts-form',
	'enableAjaxValidation'=>false,
)); ?>
          <?php
            $accounts = Coa::model()->findAll();
//            $data = CHtml::listData($accounts,'account','desc1');
$data = array();
    foreach ($accounts as $account) {
        $data[$account->account] = $account->account . ' - ' . $account->desc1;
    } 
           $i = 0;
            ?>
	<p class="note">Fields with <span class="required">*</span> are required.</p>

        <?php foreach ($models as $model): ?>
	<div class="row">
         <?php echo CHtml::label($model->name,''); ?>   
        <?php  echo CHtml::hiddenField("Defaultaccounts[$i][name]",$model->name);?>  
        <?php echo CHtml::dropDownList("Defaultaccounts[$i][account]", $model->account, $data) ?>
		
	</div>
        <?php 
            $i++;
            endforeach; 
        ?>
	<div class="row buttons">
		<?php echo CHtml::submitButton('Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->
